﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>宾果高校</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <link rel="stylesheet" href="../css/style.css">
    <link rel="stylesheet" href="../css/sweetalert.min.css" />
    <script src="../js/jquery-1.12.2.min.js"></script>
    <script src="../js/common.js"></script>
    <script src="../js/angular.min.js"></script>
    <script src="../js/sweetalert.min.js"></script>
</head>
<body>
    <div ng-app="myApp1">
        <div id="divAudit" class="hidden">
            <div id="divAuditPending" class="hidden">
                <div class="wrap">
                    <div class="panel panel-default">
                        <div class="panel-body">
                            <h2 class="text-center">您的认证申请已提交至后台审核</h2>
                            <hr>
                            <div class="form-group text-center">
                                收到资料后我们将在24小时内进行人工审核，并将审核结果发送至平台- 个人信息 - 我的认证 - 界面。
                            </div>
                            <div class="form-group text-center">
                                请耐心等候~
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div id="divAuditSuccess" class="hidden">
                <div class="wrap">
                    <div class="panel panel-default">
                        <div class="panel-body" ng-model="names">
                            <h2 class="text-center">您的个人信息审核成功</h2>
                            <hr>
                            <!--<div class="form-group text-center">提交审核的时间：	审核通过的时间{{}}	</div>-->
                            <div class="form-group text-center">恭喜您在平台获得以下权限：创建、绑定社团、企业赞助区中查阅海量信息、发布活动书等~</div>
                            <div class="form-group text-center"><button type="button" onclick="Go(this, 'AuditSuccess')" class="btn btn-default">查看我的信息</button></div>
                        </div>
                    </div>
                </div>
            </div>
            <div id="divAuditFailed" class="hidden">
                <div class="wrap">
                    <div class="panel panel-default">
                        <div class="panel-body" ng-model="names">
                            <h2 class="text-center">您的个人信息审核失败</h2>
                            <hr>
                            <!--<div class="form-group text-center">提交审核的时间：{{}}		审核失败的时间{{}}	</div>-->
                            <div class="form-group text-center">您审核未通过的原因可能为：</div>
                            <div class="form-group text-center">{{names.Remark}}</div>
                            <div class="form-group text-center">请您重新确认个人信息并再次提交申请：</div>
                            <div class="form-group text-center"><button type="button" tag="{{names.ProjectNO}}" onclick="Go(this, 'AuditFailed')" class="btn btn-default">重新认证</button></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div id="divBooks" class="hidden">
            <div class="wrap">
                <div class="panel panel-default">
                    <div class="panel-body" ng-model="names">
                        <span>赞助名称：{{names.ProjectName}}</span>
                        <br>
                        <span>赞助类型：</span><span ng-repeat="w in names.Type">{{w + ","}}</span>
                        <br>
                        <span>活动地区：</span><span ng-repeat="y in names.City">{{y + ","}}</span>
                        <br>
                        <span>赞助提供金额：{{names.Money}}</span>
                        <br>
                        <span>赞助物质：</span><span ng-repeat="z in names.Material">{{z + ","}}</span>
                        <br>
                        <span>赞助希望涉及学生总数（人）：{{names.EntrantsName}}</span>
                        <br>
                        <span>赞助时间：{{names.StartTime | date:'yyyy-MM-dd'}} - {{names.EndTime | date:'yyyy-MM-dd'}}</span>
                        <br>
                        <span>活动紧急联系人和电话：{{names.UrgentRemark}}</span>
                        <br>
                        <span>方案：<a href="{{names.FileSys.Path}}" target="_blank">{{names.FileSys.OldName}}</a> </span>
                        <br>
                        <span>方案要求：{{names.ProjectRequire}}</span>
                        <br>
                    </div>
                </div>
            </div>
        </div>
        <div id="divAssocBooks" class="hidden">
            <div class="main wrap">
                <table ng-model="names" class="table table-hover">
                    <tr>
                        <td>活动名称</td>
                        <td>{{names.ProjectName}}</td>
                    </tr>
                    <tr>
                        <td>活动类型</td>
                        <td>{{names.Nature}}</td>
                    </tr>
                    <tr>
                        <td>活动时间（开始时间-结束时间）</td>
                        <td>{{names.StartTime | date:'yyyy-MM-dd'}}-{{names.EndTime | date:'yyyy-MM-dd'}}</td>
                    </tr>
                    <tr>
                        <td>活动场次</td>
                        <td>{{names.ActivityAmount}}</td>
                    </tr>
                    <tr>
                        <td>活动涉及学生总数（人）</td>
                        <td>{{names.EntrantsName}}</td>
                    </tr>
                    <tr>
                        <td>活动所需金额</td>
                        <td>{{names.MoneyName}}</td>
                    </tr>
                    <tr>
                        <td>所属社团地区</td>
                        <td>{{names.City}}</td>
                    </tr>
                    <tr>
                        <td>所属社团名称</td>
                        <td>{{names.AssocName}}</td>
                    </tr>
                    <tr>
                        <td>活动简介</td>
                        <td>{{names.ProjectRequire}}</td>
                    </tr>
                    <tr>
                        <td>策划书下载</td>
                        <td><a href="{{names.SponsorBook}}" target="_blank">下载</a></td>
                    </tr>
                    <tr>
                        <td>活动所需物资：活动海报（A2，A3，A4）</td>
                        <td>{{names.M900000066}}</td>
                    </tr>
                    <tr>
                        <td>活动展架</td>
                        <td>{{names.M900000067}}</td>
                    </tr>
                    <tr>
                        <td>横幅</td>
                        <td>{{names.M900000069}}</td>
                    </tr>
                    <tr>
                        <td>传单(黑白，彩色)</td>
                        <td>{{names.M900000070}}</td>
                    </tr>
                    <tr>
                        <td>KT板</td>
                        <td>{{names.M900000071}}</td>
                    </tr>
                    <tr>
                        <td>幕布</td>
                        <td>{{names.M900000072}}</td>
                    </tr>
                    <tr>
                        <td>易拉宝</td>
                        <td>{{names.M900000073}}</td>
                    </tr>
                    <tr>
                        <td>推头</td>
                        <td>{{names.M900000074}}</td>
                    </tr>
                    <tr>
                        <td>灯布</td>
                        <td>{{names.M900000075}}</td>
                    </tr>
                    <tr>
                        <td>木构</td>
                        <td>{{names.M900000076}}</td>
                    </tr>
                    <tr>
                        <td>展位</td>
                        <td>{{names.M900000077}}</td>
                    </tr>
                    <tr>
                        <td>灯箱</td>
                        <td>{{names.M900000078}}</td>
                    </tr>
                    <tr>
                        <td>桁架</td>
                        <td>{{names.M900000079}}</td>
                    </tr>
                    <tr>
                        <td>麦克风(耳麦，手麦，麦架)</td>
                        <td>{{names.M900000080}}</td>
                    </tr>
                    <tr>
                        <td>帐篷</td>
                        <td>{{names.M900000081}}</td>
                    </tr>
                    <tr>
                        <td>桌椅</td>
                        <td>{{names.M900000082}}</td>
                    </tr>
                    <tr>
                        <td>音箱</td>
                        <td>{{names.M900000083}}</td>
                    </tr>
                    <tr>
                        <td>其他</td>
                        <td>{{names.M900000086}}</td>
                    </tr>
                </table>
                <div class="activity-photo">
                    <ul class="clearfix">
                        <li>
                            <div class="thumbnail">
                                <img src="{{names.ActImg1}}" alt="">
                                <p class="text-center">活动图片1（往届图片）</p>
                            </div>
                        </li>
                        <li>
                            <div class="thumbnail">
                                <img src="{{names.ActImg2}}" alt="">
                                <p class="text-center">活动图片2（往届图片）</p>
                            </div>
                        </li>
                        <li>
                            <div class="thumbnail">
                                <img src="{{names.ActImg3}}" alt="">
                                <p class="text-center">活动图片3（往届图片）</p>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
            <div id="divScheme" class="hidden">
                <div class="wrap">
                    <div class="panel panel-default">
                        <div class="panel-body" ng-model="names">
                            <span>方案名称：{{names.ProjectName}}</span>
                            <br>
                            <span>活动时间：{{names.StartTime | date:'yyyy-MM-dd'}} - {{names.EndTime | date:'yyyy-MM-dd'}}</span>
                            <br>
                            <span>企业提供赞助金额：{{names.Money}}</span>
                            <br>
                            <span>方案：<a href="{{names.FileSys.Path}}" target="_blank">{{names.FileSys.OldName}}</a> </span>
                            <br>
                            <span>方案要求：{{names.ProjectRequire}}</span>
                            <br>
                        </div>
                    </div>
                </div>
            </div>
            <div id="divAssocScheme" class="hidden">
                <div class="wrap">
                    <div class="panel panel-default">
                        <div class="panel-body" ng-model="names">
                            <span>方案名称：{{names.ProjectName}}</span>
                            <br>
                            <span>活动时间：{{names.StartTime | date:'yyyy-MM-dd'}} - {{names.EndTime | date:'yyyy-MM-dd'}}</span>
                            <br>
                            <span>希望企业提供赞助金额：{{names.Money}}</span>
                            <br>
                            <span>所属社团：{{names.Address}}</span>
                            <br>
                            <span>活动简介：{{names.Address}}</span>
                            <br>
                            <span>方案：<a href="{{names.FileSys.Path}}" target="_blank">{{names.FileSys.OldName}}</a> </span>
                            <br>
                        </div>
                    </div>
                </div>
            </div>
            <div id="divCancel" class="hidden">
                <div class="wrap">
                    <div class="panel panel-default">
                        <div class="panel-body">
                            <label for="">活动类型：</label>
                            <label class="checkbox-inline">
                                <input type="checkbox" name="EntrantsName" value="1"><span>信息不匹配</span>
                            </label>
                            <label class="checkbox-inline">
                                <input type="checkbox" name="EntrantsName" value="2"><span>社团规模太小</span>
                            </label>
                            <label class="checkbox-inline">
                                <input type="checkbox" name="EntrantsName" value="3"><span>社团所在地不是所需所在地</span>
                            </label>
                            <label class="checkbox-inline">
                                <input type="checkbox" name="EntrantsName" value="4"><span>其他</span>
                            </label>
                            <div class="form-group text-center"><button type="button" onclick="Go('Cancel')" class="btn btn-default">提交</button></div>
                        </div>
                    </div>
                </div>
            </div>
            <div id="divMessage" class="hidden">
                <div class="wrap">
                    <div class="panel panel-default">
                        <div class="panel-body">
                            <h2 class="text-center">无记录.</h2>
                        </div>
                    </div>
                </div>
            </div>
        </div>
</body>
</html>
<script>
    var param = common.getUrlArgStr();
    var mode = param.mode;
    if (mode == undefined || param.id == undefined || param.id == "") {
        var app = angular.module('myApp1', []);
        ShowMessage();
    }
    else {
        var ctrl, url;

        switch (mode) {
            case "Audit":
                ctrl = "auditCtrl";
                url = "../api/student/get";
                break;
            case "Books":
                ctrl = "booksCtrl";
                url = "../api/project/get/" + param.id;
                break;
            case "AssocBooks":
                ctrl = "assocBooksCtrl";
                url = "../api/student/GetProject?id=" + param.id;
                break;
            case "Scheme":
                ctrl = "schemeCtrl";
                url = "../api/project/get/" + param.id;
                break;
            case "AssocScheme":
                ctrl = "assocSchemeCtrl";
                url = "../api/student/GetProject?id=" + param.id;
                break;
        }

        $("#div" + mode).removeClass().show();
        $("#div" + mode).attr("ng-controller", ctrl);
        var app = angular.module('myApp1', []);

        app.controller(ctrl, function ($http, $scope) {
            //list
            $http.get(url).success(function (data) {

                if (data == null || data.ResponseObj == null) {
                    ShowMessage();
                    return;
                }

                if (mode = "Audit") {

                    switch (data.ResponseObj.Status) {
                        case 0:
                            $("#divAuditPending").removeClass().show();
                            return;
                        case 1:
                            $("#divAuditSuccess").removeClass().show();
                            break;
                        case 2:
                            $("#divAuditFailed").removeClass().show();
                            break;
                    }
                }

                $scope.names = data.ResponseObj;
            }).error(function (data, status, headers, config) {

                ShowMessage();
            });
        });
    }

    function Go(obj, type) {
        switch (type) {
            case "AuditSuccess":
                var index = parent.layer.getFrameIndex(window.name);
                //parent.layer.msg('您将标记 [ ' + val + ' ] 成功传送给了父窗口');
                //parent.$('#parentIframe').text('我被改变了');
                parent.window.location = "info.html";
                parent.layer.close(index);

                break;
            case "AuditFailed":
                var id = $(obj).attr("tag");
                var index = parent.layer.getFrameIndex(window.name);
                parent.window.location = "step1.html?mode=edit";
                parent.layer.close(index);
                break;
            case "Cancel":
                break;
        }
    }

    function ShowMessage() {
        $("#divMessage").removeClass().show();
    }

</script>